/**
 * @projectName: pet-joy-home
 * @author: 小飞
 * @description: TODO
 * @date: 2024/3/4 11:44
 * @version: 1.0
 */
package com.home.utils;
import com.home.entity.LoginUser;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityContextUtil {
    public static LoginUser getLoginUser() {
        return (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }

}
